#!/bin/bash

set -e

rm -rf bin

cleanup_exit() {
  echo "Test failed"
  exit ${1}
}

echo "Build should succeed"
../../build.py build ... || cleanup_exit 1
../../pretty_graph_dump.py bin/__graph__/newgraph.db | diff reference_graph1 - || cleanup_exit 1

rm -rf bin

echo 'Test passed'
